package com.cwf.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.cwf.system.vo.ValidGroup;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;
import java.io.Serializable;

/**
 * (Role)实体类
 *
 * @author makejava
 * @since 2023-02-15 12:43:50
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@ToString
public class Role implements Serializable {
    private static final long serialVersionUID = 552628909524661931L;
    /**
     * 角色id
     */
    @TableId(type = IdType.AUTO)
    @Null(groups = ValidGroup.Crud.Create.class, message = "不需要填写id")
    @NotNull(groups = ValidGroup.Crud.Update.class,message = "id不能为空")
    @NotNull(groups = ValidGroup.Crud.Delete.class,message = "id不能为空")
    private Long roleId;
    /**
     * 角色名称
     */
    @NotNull(groups = ValidGroup.Crud.Create.class, message = "角色名称不能为空")
    @Length(max = 10)
    private String roleName;
    /**
     * 角色描述
     */
    private String roleDesc;
    /**
     * 最后编辑人id
     */
    private Long editUserId;
    /**
     * 创建者id
     */
    private Long creatorId;
    /**
     * 状态
     */
    private Integer state;
    /**
     * 逻辑删除
     */
    private Integer isDelete;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;


}

